package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysUserScanMapper;
import com.ruoyi.system.domain.SysUserScan;
import com.ruoyi.system.service.ISysUserScanService;

/**
 * 扫码记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-09
 */
@Service
public class SysUserScanServiceImpl implements ISysUserScanService 
{
    @Autowired
    private SysUserScanMapper sysUserScanMapper;

    /**
     * 查询扫码记录
     * 
     * @param scanId 扫码记录主键
     * @return 扫码记录
     */
    @Override
    public SysUserScan selectSysUserScanByScanId(Long scanId)
    {
        return sysUserScanMapper.selectSysUserScanByScanId(scanId);
    }

    /**
     * 查询扫码记录列表
     * 
     * @param sysUserScan 扫码记录
     * @return 扫码记录
     */
    @Override
    public List<SysUserScan> selectSysUserScanList(SysUserScan sysUserScan)
    {
        return sysUserScanMapper.selectSysUserScanList(sysUserScan);
    }

    /**
     * 新增扫码记录
     * 
     * @param sysUserScan 扫码记录
     * @return 结果
     */
    @Override
    public int insertSysUserScan(SysUserScan sysUserScan)
    {
        sysUserScan.setCreateTime(DateUtils.getNowDate());
        return sysUserScanMapper.insertSysUserScan(sysUserScan);
    }

    /**
     * 修改扫码记录
     * 
     * @param sysUserScan 扫码记录
     * @return 结果
     */
    @Override
    public int updateSysUserScan(SysUserScan sysUserScan)
    {
        sysUserScan.setUpdateTime(DateUtils.getNowDate());
        return sysUserScanMapper.updateSysUserScan(sysUserScan);
    }

    /**
     * 批量删除扫码记录
     * 
     * @param scanIds 需要删除的扫码记录主键
     * @return 结果
     */
    @Override
    public int deleteSysUserScanByScanIds(Long[] scanIds)
    {
        return sysUserScanMapper.deleteSysUserScanByScanIds(scanIds);
    }

    /**
     * 删除扫码记录信息
     * 
     * @param scanId 扫码记录主键
     * @return 结果
     */
    @Override
    public int deleteSysUserScanByScanId(Long scanId)
    {
        return sysUserScanMapper.deleteSysUserScanByScanId(scanId);
    }
}
